#include<stdio.h>
int main()
{
    int n, i, j, k, m, a[10] = { 0 }, b = 0, x, y;
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%d", &m);
        while (m)
        {
            x = m % 10;
            m /= 10;
            switch (x)
            {
            case 0:a[0]++; break;
            case 1:a[1]++; break;
            case 2:a[2]++; break;
            case 3:a[3]++; break;
            case 4:a[4]++; break;
            case 5:a[5]++; break;
            case 6:a[6]++; break;
            case 7:a[7]++; break;
            case 8:a[8]++; break;
            case 9:a[9]++; break;
            }
        }
    }
    b = a[0];
    for (i = 1; i <= 9; i++)
        if (b < a[i])
            b = a[i];
    printf("%d:", b);
    for (i = 0; i <= 9; i++)
        if (a[i] == b)
            printf(" %d", i);
    return 0;
}
